package com.jege.jpa.many2many;

import javax.persistence.*;

/**
 * Created by ange on 2017/2/22.
 */
@Entity
public class Admin {
    private int id;

    private Integer level;

    private User user;

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }


    @Basic
    @Column(name = "level")
    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    @OneToOne
    @PrimaryKeyJoinColumn(name = "id", referencedColumnName = "id", foreignKey = @ForeignKey(name = "fk_admin_user"))
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}
